#!/usr/bin/python
#-*- coding: utf-8 -*-


import os
import sys
import random

reload(sys)
sys.setdefaultencoding('UTF-8')


card = list(range(52))

random.shuffle(card)

def t(a):
    list1 = ['A','K','Q','J','10','9','8','7','6','5','4','3','2','1']
    return list1[a]

player = [[],[],[],[]]

for i in range(4):
    player[i] = card[i*13: 13+i*13 ]
    player[i].sort(reverse = True)

    black = []
    red = []
    rec = []
    grass = []


    for j in range(13):
        if player[i][j] > 38:
            black.insert(0,t(player[i][j] - 39))
        elif player[i][j] > 25:
            red.insert(0,t(player[i][j]-26))
        elif player[i][j] > 12:
            rec.insert(0,t(player[i][j] - 13))
        else:
            grass.insert(0,t(player[i][j]))



    print('玩家%s手中纸牌：'%(i+1))
    print('黑桃：','%s '*len(black)%tuple(black))
    print('红心：','%s '*len(red)%tuple(red))
    print('方块：','%s '*len(rec)%tuple(rec))
    print('草花：','%s '*len(grass)%tuple(grass), '\n')